﻿@using ChampionsLeagueBets.Domain
@using MvcContrib
@using MvcContrib.UI.Grid
@model IList<Tournament>

@{
    ViewBag.Title = "Twoje zakłady";
	ViewBag.Image = "~/Content/images/dollars-64.png";
}

@Html.Grid(Model).RowAttributes(data => new Hash(@class => data.IsAlternate ? "row-normal" : "row-grayed")).Columns(column => 
        {
			column.For(cust => cust.Name);
			column.For(cust => cust.StartDate).Format("{0:dd-MM-yy}");
			column.For(cust => cust.EndDate).Format("{0:dd-MM-yy}");
			column.For(cust => cust.Games != null ? cust.Games.Where(g => !g.IsDeleted).Count() : 0).Named("Liczba meczy");
			column.For(cust => Html.ActionLink<TournamentsController>(c => c.Classification(cust.Id), "Klasyfikacja")).Named("Klasyfikacja");
			column.For(cust => Html.ActionLink<TournamentsController>(c => c.UserGames(cust.Id), "Zakłady")).Named("Zakłady");
        }
    )
